package com.hotelvip.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.hotelvip.common.utils.EnumUtil;
import com.hotelvip.entity.Label;
import com.hotelvip.entity.User;
import com.hotelvip.entity.VipUser;
import com.hotelvip.enumEntity.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * User的vo对象
 * @author Lzh
 * @date 2020/12/14 15:57
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Accessors(chain = true)
@ApiModel(value = "客户用户vo对象",description = "客户用户对象UserVo")
public class UserVo {
    @ApiModelProperty(value = "客户用户对象",name = "user")
    private User user;
    @ApiModelProperty(value = "会员装填",name = "vStatusText")
    private String vStatusText;
    @ApiModelProperty(value = "民族",name = "nationText")
    private String nationText;
    @ApiModelProperty(value = "信仰",name = "faithText")
    private String faithText;
    @ApiModelProperty(value = "是否企业",name = "comFText")
    private String comFText;
    @ApiModelProperty(value = "行业",name = "professionText")
    private String professionText;
    @ApiModelProperty(value = "性别",name = "genderText")
    private String genderText;
    @ApiModelProperty(value = "证件类型",name = "idTypeText")
    private String idTypeText;
    @ApiModelProperty(value = "职务",name = "jobText")
    private String jobText;
    @ApiModelProperty(value = "年龄段",name = "ageGroupText")
    private String ageGroupText;

    @ApiModelProperty(value = "介绍人身份",name = "identity")
    private Integer identityId;

    @ApiModelProperty(value = "用户特殊情况",name = "label")
    private List<Label> labels;
    @ApiModelProperty(value = "用户所在地区",name = "region")
    private String regionText;

    @ApiModelProperty(value = "用户会员卡信息",name = "vipUserList")
    private List<VipUser> vipUserList;


    public String getVStatusText(){
        if (user.getVStatus()==null || EnumUtil.getByindex(user.getVStatus(), FlagEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getVStatus(), FlagEnum.class).getName();
    }
    public String getNationText(){
        if (user.getNation()==null || EnumUtil.getByindex(user.getNation(), NationEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getNation(), NationEnum.class).getName();
    }
    public String getFaithText(){
        if(user.getFaith()==null || EnumUtil.getByindex(user.getFaith(), ZjxyEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getFaith(), ZjxyEnum.class).getName();
    }
    public String getComFText(){
        if (user.getComF()==null || EnumUtil.getByindex(user.getComF(), FlagEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getComF(), FlagEnum.class).getName();
    }
    public String getProfessionText(){
        if (user.getProfession()==null || EnumUtil.getByindex(user.getProfession(), IndustryEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getProfession(), IndustryEnum.class).getName();
    }
    public String getGenderText(){
        if (user.getGender()==null || EnumUtil.getByindex(user.getGender(), GenderEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getGender(), GenderEnum.class).getName();
    }
    public String getIdTypeText(){
        if (user.getIdType()==null || EnumUtil.getByindex(user.getIdType(), IdTypeEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getIdType(), IdTypeEnum.class).getName();
    }
    public String getJobText(){
        if (user.getJob()==null || EnumUtil.getByindex(user.getJob(), JobEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getJob(), JobEnum.class).getName();
    }
    public String getAgeGroupText(){
        if (user.getAgeGroup()==null || EnumUtil.getByindex(user.getAgeGroup(), AgeGroupEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getAgeGroup(), AgeGroupEnum.class).getName();
    }
    public String getIdentityText(){
        if (user.getIdentity()==null || EnumUtil.getByindex(user.getIdentity(), IdentityEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getIdentity(), IdentityEnum.class).getName();
    }
    public String regionIdText(){
        if (user.getRegion()==null || EnumUtil.getByindex(user.getRegion(), RegionEnum.class)==null)
            return "";
        return EnumUtil.getByindex(user.getRegion(), RegionEnum.class).getName();
    }

}
